package org.domeos.framework.api.model.deployment.related;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 */
@ApiModel("检查对象(健康检查,就绪性检查)")
public class HealthChecker {

	@ApiModelProperty(required = true , dataType = "enum" , value = "健康检查类型" , example = "TCP or HTTP")
    HealthCheckerType type = HealthCheckerType.NONE;
	@ApiModelProperty(required = true , dataType = "int" , value = "端口")
    int port;
	@ApiModelProperty(dataType = "int" , value = "延迟")
    int delay = 30; // in second
	@ApiModelProperty(dataType = "int" , value = "超时时间")
    int timeout; // in second
	@ApiModelProperty(dataType = "int" , value = "失败次数")
    int failureThreshold = 3;
	@ApiModelProperty(dataType = "int" , value = "成功次数")
    int successThreshold = 1;
	@ApiModelProperty(dataType = "int" , value = "检查周期(s)")
    int periodSeconds = 10;
	@ApiModelProperty(required = true , dataType = "string" , value = "检查URL")
    String url;

    public HealthCheckerType getType() {
        return type;
    }

    public void setType(HealthCheckerType type) {
        this.type = type;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public int getDelay() {
        return delay;
    }

    public void setDelay(int delay) {
        this.delay = delay;
    }

    public int getTimeout() {
        return timeout;
    }

    public void setTimeout(int timeout) {
        this.timeout = timeout;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getFailureThreshold() {
        return failureThreshold;
    }

    public void setFailureThreshold(int failureThreshold) {
        this.failureThreshold = failureThreshold;
    }

    public int getSuccessThreshold() {
        return successThreshold;
    }

    public void setSuccessThreshold(int successThreshold) {
        this.successThreshold = successThreshold;
    }

    public int getPeriodSeconds() {
        return periodSeconds;
    }

    public void setPeriodSeconds(int periodSeconds) {
        this.periodSeconds = periodSeconds;
    }
}
